|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
april 2011 doc id 15403 rev 3 1/1317 RM0033 reference manual stm32f205xx, stm32f207xx, stm32f215xx and stm32f217xx advanced arm-based 32-bit mcus introduction this reference manual targets application deve lopers. it provides complete information on how to use the stm32f205xx, stm32f207xx, stm32f215xx and stm32f217xx microcontroller memory and peripherals. the stm32f205xx, stm32f207xx, stm32f215xx and stm32f217xx will be referr ed to as stm32f20x and stm32f21x throughout the document, unless otherwise specified. the stm32f20x and stm32f21x constitute a family of microcontrollers with different memory sizes, packages and peripherals. for ordering information, mechanical and electrical device characteristics please refer to the stm32f20x and stm32f21x datasheets. for information on programming, erasing and protection of the internal flash memory please refer to the stm32f20x and stm32f21x flash programming manual. for information on the arm cortex?-m3 core, please refer to the cortex?-m3 technical reference manual . related documents available from www.arm.com: cortex?-m3 technical reference manual, available from: http://infocenter.arm.com/help /topic/com.arm.doc.d di0337g/ddi0337g_cor tex_m3_r2p0_trm.pdf available from your stmicr oelectronics sales office: stm32f20x and stm32f21x datasheets stm32f20x and stm32f21x flash programming manual cortex-m3 programming manual (pm0056) www.st.com http://
contents RM0033 2/1317 doc id 15403 rev 3 contents 1 documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 1.1 list of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 1.2 peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2 memory and bus architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.1 system architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.1.1 s0: i-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.1.2 s1: d-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.1.3 s2: s-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.1.4 s3, s4: dma memory bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.1.5 s5: dma peripheral bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.1.6 s6: ethernet dma bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.1.7 s7: usb otg hs dma bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.1.8 busmatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.1.9 ahb/apb bridges (apb) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.2 memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.3 memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.3.1 embedded sram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.3.2 bit banding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 2.3.3 embedded flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.3.4 flash memory read interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.3.5 adaptive real-time memory accelerator (art accelerator?) . . . . . . . . 57 2.4 boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3 crc calculation unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.1 crc introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.2 crc main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.3 crc functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.4 crc registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.4.1 data register (crc_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.4.2 independent data register (crc_idr) . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.4.3 control register (crc_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.4.4 crc register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 RM0033 contents doc id 15403 rev 3 3/1317 4 power control (pwr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4.1 power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4.1.1 independent a/d converter supply and reference voltage . . . . . . . . . . . 64 4.1.2 battery backup domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 4.1.3 voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.2 power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4.2.1 power-on reset (por)/power-down reset (pdr) . . . . . . . . . . . . . . . . . . 67 4.2.2 brownout reset (bor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.2.3 programmable voltage detector (pvd) . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.3 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 4.3.1 slowing down system clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.3.2 peripheral clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.3.3 sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.3.4 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.3.5 standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.3.6 programming the rtc alternate functions to wake up the device from the stop and standby modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.4 power control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 4.4.1 pwr power control register (pwr_cr) . . . . . . . . . . . . . . . . . . . . . . . . 78 4.4.2 pwr power control/status register (pwr_csr) . . . . . . . . . . . . . . . . . . 79 4.4.3 pwr register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 5 reset and clock control (rcc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5.1 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5.1.1 system reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5.1.2 power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 5.1.3 backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 5.2 clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 5.2.1 hse clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5.2.2 hsi clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 5.2.3 pll configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.2.4 lse clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.2.5 lsi clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.2.6 system clock (sysclk) selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.2.7 clock security system (css) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.2.8 rtc/awu clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 5.2.9 watchdog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 contents RM0033 4/1317 doc id 15403 rev 3 5.2.10 clock-out capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.2.11 internal/external clock measurement using tim5/tim11 . . . . . . . . . . . . 90 5.3 rcc registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.3.1 rcc clock control register (rcc_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.3.2 rcc pll configuration register (rcc_pllcfgr) . . . . . . . . . . . . . . . . 94 5.3.3 rcc clock configuration register (rcc_cfgr) . . . . . . . . . . . . . . . . . . 96 5.3.4 rcc clock interrupt regist er (rcc_cir) . . . . . . . . . . . . . . . . . . . . . . . . 98 5.3.5 rcc ahb1 peripheral reset register (rcc_ahb1rstr) . . . . . . . . . . 101 5.3.6 rcc ahb2 peripheral reset register (rcc_ahb2rstr) . . . . . . . . . . 103 5.3.7 rcc ahb3 peripheral reset register (rcc_ahb3rstr) . . . . . . . . . . 104 5.3.8 rcc apb1 peripheral re set register (rcc_apb1rstr) . . . . . . . . . . 104 5.3.9 rcc apb2 peripheral re set register (rcc_apb2rstr) . . . . . . . . . . 107 5.3.10 rcc ahb1 peripheral clock register (rcc_ahb1enr) . . . . . . . . . . . 109 5.3.11 rcc ahb2 peripheral clock enable register (rcc_ahb2enr) . . . . . 111 5.3.12 rcc ahb3 peripheral clock enable register (rcc_ahb3enr) . . . . . 112 5.3.13 rcc apb1 peripheral clock enable register (rcc_apb1enr) . . . . . 112 5.3.14 rcc apb2 peripheral clock enable register (rcc_apb2enr) . . . . . 115 5.3.15 rcc ahb1 peripheral clock enable in low power mode register (rcc_ahb1lpenr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5.3.16 rcc ahb2 peripheral clock enable in low power mode register (rcc_ahb2lpenr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.3.17 rcc ahb3 peripheral clock enable in low power mode register (rcc_ahb3lpenr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.3.18 rcc apb1 peripheral clock en able in low power mode register (rcc_apb1lpenr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 5.3.19 rcc apb2 peripheral clock enab led in low power mode register (rcc_apb2lpenr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 5.3.20 rcc backup domain control register (rcc_bdcr) . . . . . . . . . . . . . . 126 5.3.21 rcc clock control & status register (rcc_csr) . . . . . . . . . . . . . . . . 127 5.3.22 rcc spread spectrum clock generation register (rcc_sscgr) . . . . 129 5.3.23 rcc plli2s configuration register (rcc_plli2scfgr) . . . . . . . . . 130 5.3.24 rcc register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 6 general-purpose i/os (gpi o) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 6.1 gpio introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 6.2 gpio main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 6.3 gpio functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 6.3.1 general-purpose i/o (gpio) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 RM0033 contents doc id 15403 rev 3 5/1317 6.3.2 i/o pin multiplexer and mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 6.3.3 i/o port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 6.3.4 i/o port data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 6.3.5 i/o data bitwise handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 6.3.6 gpio locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 6.3.7 i/o alternate function input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 6.3.8 external interrupt/wakeup lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 6.3.9 input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 6.3.10 output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 6.3.11 alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 6.3.12 analog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 6.3.13 using the osc32_in/osc32_out pins as gpio pc14/pc15 port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 6.3.14 using the osc_in/osc_out pins as gpio ph0/ph1 port pins . . . . 144 6.3.15 selection of rtc_af1 and rtc_af2 alternate functions . . . . . . . . . . 144 6.4 gpio registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 6.4.1 gpio port mode register (gpiox_moder) (x = a..i) . . . . . . . . . . . . . 145 6.4.2 gpio port ou tput type register (gpiox_otyper ) (x = a..i) . . . . . . . . 146 6.4.3 gpio port ou tput speed register (gpiox_ospeedr) (x = a..i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 6.4.4 gpio port pull-up/pull-down register (gpiox_pupdr) (x = a..i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 6.4.5 gpio port input data register (gpiox_idr) (x = a..i) . . . . . . . . . . . . . 147 6.4.6 gpio port output data register (gpiox_odr) (x = a..i) . . . . . . . . . . . 148 6.4.7 gpio port bit set/reset register (gpiox_bsrr) (x = a..i) . . . . . . . . . . 148 6.4.8 gpio port configuration lock register (gpiox_lckr) (x = a..i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 6.4.9 gpio alternate function low register (gpiox_afrl) (x = a..i) . . . . . . 149 6.4.10 gpio alternate function high register (gpiox_afrh) (x = a..i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 6.4.11 gpio register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 7 system configuration controlle r (syscfg) . . . . . . . . . . . . . . . . . . . . 153 7.1 i/o compensation cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 7.2 syscfg registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 7.2.1 syscfg memory remap register ( syscfg_memrmp) . . . . . . . . . . 153 7.2.2 syscfg peripheral mo de configuration register (syscfg_pmc) . . 155 7.2.3 syscfg external interrupt configuration register 1 (syscfg_exticr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 contents RM0033 6/1317 doc id 15403 rev 3 7.2.4 syscfg external interrupt configuration register 2 (syscfg_exticr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 7.2.5 syscfg external interrupt configuration register 3 (syscfg_exticr3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 7.2.6 syscfg external interrupt configuration register 4 (syscfg_exticr4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 7.2.7 compensation ce ll control register (syscfg_cmpcr) . . . . . . . . . . . 157 7.2.8 syscfg register maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 8 interrupts and events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 8.1 nested vectored interrupt controller (nvic) . . . . . . . . . . . . . . . . . . . . . . 159 8.1.1 nvic features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 8.1.2 systick calibration value register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 8.1.3 interrupt and exception vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 8.2 external interrupt/event controller (exti) . . . . . . . . . . . . . . . . . . . . . . . . 163 8.2.1 exti main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 8.2.2 exti block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 8.2.3 wakeup event management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 8.2.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 8.2.5 external interrupt/event line mapping . . . . . . . . . . . . . . . . . . . . . . . . . 165 8.3 exti registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 8.3.1 interrupt mask register (exti_imr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 8.3.2 event mask register (exti_emr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 8.3.3 rising trigger selection register (exti_rtsr) . . . . . . . . . . . . . . . . . . 167 8.3.4 falling trigger selection re gister (exti_ftsr) . . . . . . . . . . . . . . . . . . 167 8.3.5 software interrupt event register (exti_swier) . . . . . . . . . . . . . . . . . 168 8.3.6 pending register (exti_pr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 8.3.7 exti register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 9 dma controller (dma) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 9.1 dma introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 9.2 dma main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 9.3 dma functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 9.3.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 9.3.2 dma transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 9.3.3 channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 9.3.4 arbiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 RM0033 contents doc id 15403 rev 3 7/1317 9.3.5 dma streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 9.3.6 source, destination and transfer modes . . . . . . . . . . . . . . . . . . . . . . . 176 9.3.7 pointer incrementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 9.3.8 circular mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 9.3.9 double buffer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 9.3.10 programmable data width, packing/unpacking, endianess . . . . . . . . . 181 9.3.11 single and burst transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 9.3.12 fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 9.3.13 dma transfer completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 9.3.14 dma transfer suspension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 9.3.15 flow controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 9.3.16 summary of the possible dma configurations . . . . . . . . . . . . . . . . . . . 188 9.3.17 stream configuration procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 9.3.18 error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 9.4 dma interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 9.5 dma registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 9.5.1 dma low interrupt status register (dma_lisr) . . . . . . . . . . . . . . . . . . 191 9.5.2 dma high interrupt status register (dma_hisr) . . . . . . . . . . . . . . . . . 192 9.5.3 dma low interrupt flag clear register (dma_lifcr) . . . . . . . . . . . . . . 193 9.5.4 dma high interrupt flag clear register (dma_hifcr) . . . . . . . . . . . . . 194 9.5.5 dma stream x configuration register (dma_sxcr) (x = 0..7) . . . . . . . 195 9.5.6 dma stream x number of data register (dma_sxndtr) (x = 0..7) . . . 198 9.5.7 dma stream x peripheral address register (dma_sxpar) (x = 0..7) . 198 9.5.8 dma stream x memory 0 address register (dma_sxm0ar) (x = 0..7) 199 9.5.9 dma stream x memory 1 address register (dma_sxm1ar) (x = 0..7) 199 9.5.10 dma stream x fifo control register (dma_sxfcr) (x = 0..7) . . . . . . 200 9.5.11 dma register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 10 analog-to-digital con verter (adc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 10.1 adc introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 10.2 adc main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 10.3 adc functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 10.3.1 adc on-off control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 10.3.2 adc clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 10.3.3 channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 10.3.4 single conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 10.3.5 continuous conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 contents RM0033 8/1317 doc id 15403 rev 3 10.3.6 timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 10.3.7 analog watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 10.3.8 scan mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 10.3.9 injected channel management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 10.3.10 discontinuous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 10.4 data alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 10.5 channel-wise programmable sampling time . . . . . . . . . . . . . . . . . . . . . 213 10.6 conversion on external trigger and trigger polarity . . . . . . . . . . . . . . . . 214 10.7 fast conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 10.8 data management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 10.8.1 using the dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 10.8.2 managing a sequence of conversions without using the dma . . . . . . 216 10.8.3 conversions without dma and without overrun detection . . . . . . . . . . 216 10.9 multi adc mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 10.9.1 injected simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 10.9.2 regular simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 10.9.3 interleaved mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 10.9.4 alternate trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 10.9.5 combined regular/injected simultaneous mode . . . . . . . . . . . . . . . . . . 226 10.9.6 combined regular simultaneous + alternate trigger mode . . . . . . . . . . 226 10.10 temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 10.11 battery charge monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 10.12 adc interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 10.13 adc registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 10.13.1 adc status register (adc_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 10.13.2 adc control register 1 (adc_cr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 10.13.3 adc control register 2 (adc_cr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 10.13.4 adc sample time register 1 (adc_smpr1) . . . . . . . . . . . . . . . . . . . . 236 10.13.5 adc sample time register 2 (adc_smpr2) . . . . . . . . . . . . . . . . . . . . 236 10.13.6 adc injected channel data offset register x (adc_jofrx)(x=1..4) . . 237 10.13.7 adc watchdog higher threshold register (adc_htr) . . . . . . . . . . . . . 237 10.13.8 adc watchdog lower threshold register (adc_ltr) . . . . . . . . . . . . . . 237 10.13.9 adc regular sequence register 1 (adc_sqr1) . . . . . . . . . . . . . . . . . 238 10.13.10 adc regular sequence register 2 (adc_sqr2) . . . . . . . . . . . . . . . . . 238 10.13.11 adc regular sequence register 3 (adc_sqr3) . . . . . . . . . . . . . . . . . 239 10.13.12 adc injected sequence register (adc_jsqr) . . . . . . . . . . . . . . . . . . 239 RM0033 contents doc id 15403 rev 3 9/1317 10.13.13 adc injected data register x (adc_jdrx) (x= 1..4) . . . . . . . . . . . . . . 240 10.13.14 adc regular data register (adc_dr) . . . . . . . . . . . . . . . . . . . . . . . . . 240 10.13.15 adc common status register (adc_csr) . . . . . . . . . . . . . . . . . . . . . 242 10.13.16 adc common control register (adc_ccr) . . . . . . . . . . . . . . . . . . . . . 243 10.13.17 adc common regular data register for dual and triple modes (adc_cdr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 10.13.18 adc register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 11 digital-to-analog converter (dac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 11.1 dac introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 11.2 dac main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 11.3 dac functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 11.3.1 dac channel enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 11.3.2 dac output buffer enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 11.3.3 dac data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 11.3.4 dac conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 11.3.5 dac output voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 11.3.6 dac trigger selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 11.3.7 dma request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 11.3.8 noise generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 11.3.9 triangle-wave generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 11.4 dual dac channel conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 11.4.1 independent trigger without wave generation . . . . . . . . . . . . . . . . . . . 255 11.4.2 independent trigger with single lfsr generation . . . . . . . . . . . . . . . . 256 11.4.3 independent trigger with different lfsr generation . . . . . . . . . . . . . . 256 11.4.4 independent trigger with single triangle generation . . . . . . . . . . . . . . . 256 11.4.5 independent trigger with different triangle generation . . . . . . . . . . . . . 257 11.4.6 simultaneous software start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 11.4.7 simultaneous trigger without wave generation . . . . . . . . . . . . . . . . . . 257 11.4.8 simultaneous trigger with single lfsr generation . . . . . . . . . . . . . . . 258 11.4.9 simultaneous trigger with different lfsr generation . . . . . . . . . . . . . 258 11.4.10 simultaneous trigger with single triangle generation . . . . . . . . . . . . . . 258 11.4.11 simultaneous trigger with different triangle generation . . . . . . . . . . . . 259 11.5 dac registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 11.5.1 dac control register (dac_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 11.5.2 dac software trigger register (dac_swtrigr) . . . . . . . . . . . . . . . . . 262 contents RM0033 10/1317 doc id 15403 rev 3 11.5.3 dac channel1 12-bit right-aligned data holding register (dac_dhr12r1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 11.5.4 dac channel1 12-bit left aligned data holding register (dac_dhr12l1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 11.5.5 dac channel1 8-bit right aligned data holding register (dac_dhr8r1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 11.5.6 dac channel2 12-bit right aligned data holding register (dac_dhr12r2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 11.5.7 dac channel2 12-bit left aligned data holding register (dac_dhr12l2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 11.5.8 dac channel2 8-bit right-aligned data holding register (dac_dhr8r2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 11.5.9 dual dac 12-bit right-aligned data holding register (dac_dhr12rd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 11.5.10 dual dac 12-bit left aligned data holding register (dac_dhr12ld) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 11.5.11 dual dac 8-bit right aligned data holding register (dac_dhr8rd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 11.5.12 dac channel1 data output register (dac_dor1) . . . . . . . . . . . . . . . . 266 11.5.13 dac channel2 data output register (dac_dor2) . . . . . . . . . . . . . . . . 266 11.5.14 dac status register (dac_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 11.5.15 dac register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 12 digital camera interface (dcmi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 12.1 dcmi introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 12.2 dcmi main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 12.3 dcmi pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 12.4 dcmi clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 12.5 dcmi functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 12.5.1 dma interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 12.5.2 dcmi physical interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 12.5.3 synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 12.5.4 capture modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 12.5.5 crop feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 12.5.6 jpeg format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 12.5.7 fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 12.6 data format description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 12.6.1 data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 12.6.2 monochrome format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 RM0033 contents doc id 15403 rev 3 11/1317 12.6.3 rgb format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 12.6.4 ycbcr format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 12.7 dcmi interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 12.8 dcmi register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 12.8.1 dcmi control register 1 (dcmi_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . 280 12.8.2 dcmi status register (dcmi_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 12.8.3 dcmi raw interrupt status register (dcmi_ris) . . . . . . . . . . . . . . . . . . 283 12.8.4 dcmi interrupt enable register (dcmi_ier) . . . . . . . . . . . . . . . . . . . . 284 12.8.5 dcmi masked interrupt status register (dcmi_mis) . . . . . . . . . . . . . . 285 12.8.6 dcmi interrupt clear register (dcmi_icr) . . . . . . . . . . . . . . . . . . . . . . 286 12.8.7 dcmi embedded synchronization code register (dcmi_escr) . . . . . 286 12.8.8 dcmi embedded synchronization unmask register (dcmi_esur) . . 287 12.8.9 dcmi crop window start (dcmi_cwstrt) . . . . . . . . . . . . . . . . . . . . . 288 12.8.10 dcmi crop window size (dcmi_cwsize) . . . . . . . . . . . . . . . . . . . . . . 288 12.8.11 dcmi data register (dcmi_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 12.8.12 dcmi register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 13 advanced-control timers (tim1&tim8) . . . . . . . . . . . . . . . . . . . . . . . . 291 13.1 tim1&tim8 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 13.2 tim1&tim8 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 13.3 tim1&tim8 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 13.3.1 time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 13.3.2 counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 13.3.3 repetition counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 13.3.4 clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 13.3.5 capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 13.3.6 input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 13.3.7 pwm input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 13.3.8 forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 13.3.9 output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 13.3.10 pwm mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 13.3.11 complementary outputs and dead-time insertion . . . . . . . . . . . . . . . . 315 13.3.12 using the break function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 13.3.13 clearing the ocxref signal on an external event . . . . . . . . . . . . . . . 319 13.3.14 6-step pwm generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 13.3.15 one-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 13.3.16 encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 contents RM0033 12/1317 doc id 15403 rev 3 13.3.17 timer input xor function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 13.3.18 interfacing with hall sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 13.3.19 timx and external trigger synchronization . . . . . . . . . . . . . . . . . . . . . . 327 13.3.20 timer synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 13.3.21 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 13.4 tim1&tim8 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 13.4.1 tim1&tim8 control register 1 (timx_cr1) . . . . . . . . . . . . . . . . . . . . . 331 13.4.2 tim1&tim8 control register 2 (timx_cr2) . . . . . . . . . . . . . . . . . . . . . 332 13.4.3 tim1&tim8 slave mode control register (timx_smcr) . . . . . . . . . . . 334 13.4.4 tim1&tim8 dma/interrupt enable register (timx_dier) . . . . . . . . . . 336 13.4.5 tim1&tim8 status register (timx_sr) . . . . . . . . . . . . . . . . . . . . . . . . 338 13.4.6 tim1&tim8 event generation register (timx_egr) . . . . . . . . . . . . . . 339 13.4.7 tim1&tim8 capture/compare mode register 1 (timx_ccmr1) . . . . . 341 13.4.8 tim1&tim8 capture/compare mode register 2 (timx_ccmr2) . . . . . 344 13.4.9 tim1&tim8 capture/compare enable register (timx_ccer) . . . . . . . 345 13.4.10 tim1&tim8 counter (timx_cnt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 13.4.11 tim1&tim8 prescaler (timx_psc) . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 13.4.12 tim1&tim8 auto-reload register (timx_arr) . . . . . . . . . . . . . . . . . . . 349 13.4.13 tim1&tim8 re petition counter register (timx_rcr) . . . . . . . . . . . . . . 350 13.4.14 tim1&tim8 capture/compare register 1 (timx_ccr1) . . . . . . . . . . . . 350 13.4.15 tim1&tim8 capture/compare register 2 (timx_ccr2) . . . . . . . . . . . . 351 13.4.16 tim1&tim8 capture/compare register 3 (timx_ccr3) . . . . . . . . . . . . 351 13.4.17 tim1&tim8 capture/compare register 4 (timx_ccr4) . . . . . . . . . . . . 352 13.4.18 tim1&tim8 break and dead-time register (timx_bdtr) . . . . . . . . . . 352 13.4.19 tim1&tim8 dma control register (timx_dcr) . . . . . . . . . . . . . . . . . . 354 13.4.20 tim1&tim8 dma address for full transfer (timx_dmar) . . . . . . . . . . 355 13.4.21 tim1&tim8 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 14 general-purpose timers (tim2 to tim5) . . . . . . . . . . . . . . . . . . . . . . . . 358 14.1 tim2 to tim5 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 14.2 tim2 to tim5 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 14.3 tim2 to tim5 functional de scription . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 14.3.1 time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 14.3.2 counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 14.3.3 clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 14.3.4 capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 14.3.5 input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 RM0033 contents doc id 15403 rev 3 13/1317 14.3.6 pwm input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 14.3.7 forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 14.3.8 output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 14.3.9 pwm mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 14.3.10 one-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 14.3.11 clearing the ocxref signal on an external event . . . . . . . . . . . . . . . 382 14.3.12 encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 14.3.13 timer input xor function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 14.3.14 timers and external trigger synchronization . . . . . . . . . . . . . . . . . . . . 385 14.3.15 timer synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 14.3.16 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 14.4 tim2 to tim5 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 14.4.1 timx control register 1 (timx_cr1) . . . . . . . . . . . . . . . . . . . . . . . . . . 394 14.4.2 timx control register 2 (timx_cr2) . . . . . . . . . . . . . . . . . . . . . . . . . . 396 14.4.3 timx slave mode control register (timx_smcr) . . . . . . . . . . . . . . . . . 397 14.4.4 timx dma/interrupt enable register (timx_dier) . . . . . . . . . . . . . . . . 400 14.4.5 timx status register (timx_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 14.4.6 timx event generation register (timx_egr) . . . . . . . . . . . . . . . . . . . . 403 14.4.7 timx capture/compare mode register 1 (timx_ccmr1) . . . . . . . . . . . 404 14.4.8 timx capture/compare mode register 2 (timx_ccmr2) . . . . . . . . . . . 407 14.4.9 timx capture/compare enable register (timx_ccer) . . . . . . . . . . . . . 408 14.4.10 timx counter (timx_cnt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 14.4.11 timx prescaler (timx_psc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 14.4.12 timx auto-reload register (timx_arr) . . . . . . . . . . . . . . . . . . . . . . . . 410 14.4.13 timx capture/compare register 1 (tim x_ccr1) . . . . . . . . . . . . . . . . . 411 14.4.14 timx capture/compare register 2 (tim x_ccr2) . . . . . . . . . . . . . . . . . 411 14.4.15 timx capture/compare register 3 (timx_ccr3) (only available on tim2 and tim5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 14.4.16 timx capture/compare register 4 (timx_ccr4) (only available on tim2 and tim5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 14.4.17 timx dma control register (timx_dcr) . . . . . . . . . . . . . . . . . . . . . . . 413 14.4.18 timx dma address for full transfer (timx_dmar) . . . . . . . . . . . . . . . 413 14.4.19 tim2 option register (tim2_or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 14.4.20 tim5 option register (tim5_or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 14.4.21 timx register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 15 general-purpose timers (tim9 to tim14) . . . . . . . . . . . . . . . . . . . . . . . 418 contents RM0033 14/1317 doc id 15403 rev 3 15.1 tim9 to tim14 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 15.2 tim9 to tim14 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 15.2.1 tim9/tim12 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 15.3 tim10/tim11 and tim13/tim14 main features . . . . . . . . . . . . . . . . . . . 419 15.4 tim9 to tim14 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 15.4.1 time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 15.4.2 counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 15.4.3 clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 15.4.4 capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 15.4.5 input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 15.4.6 pwm input mode (only for tim9/12) . . . . . . . . . . . . . . . . . . . . . . . . . . 429 15.4.7 forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 15.4.8 output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 15.4.9 pwm mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 15.4.10 one-pulse mode (only for tim9/12) . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 15.4.11 tim9/12 external trigger synchronization . . . . . . . . . . . . . . . . . . . . . . . 434 15.4.12 timer synchronization (tim9/12) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 15.4.13 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 15.5 tim9 and tim12 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 15.5.1 tim9/12 control register 1 (timx_cr1) . . . . . . . . . . . . . . . . . . . . . . . . 438 15.5.2 tim9/12 control register 2 (timx_cr2) . . . . . . . . . . . . . . . . . . . . . . . . 439 15.5.3 tim9/12 slave mode control register (timx_smcr) . . . . . . . . . . . . . . 440 15.5.4 tim9/12 interrupt enable register (timx_dier) . . . . . . . . . . . . . . . . . 441 15.5.5 tim9/12 status register (timx_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 15.5.6 tim9/12 event generation register (timx_egr) . . . . . . . . . . . . . . . . . 443 15.5.7 tim9/12 capture/compare mode register 1 (timx_ccmr1) . . . . . . . . 444 15.5.8 tim9/12 capture/compare enable register (timx_ccer) . . . . . . . . . . 447 15.5.9 tim9/12 counter (timx_cnt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 15.5.10 tim9/12 prescaler (timx_psc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 15.5.11 tim9/12 auto-reload register (timx_arr) . . . . . . . . . . . . . . . . . . . . . 448 15.5.12 tim9/12 capture/compare register 1 (timx_ccr1) . . . . . . . . . . . . . . 449 15.5.13 tim9/12 capture/compare register 2 (timx_ccr2) . . . . . . . . . . . . . . 449 15.5.14 tim9/12 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 15.6 tim10/11/13/14 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 15.6.1 tim10/11/13/14 control register 1 (timx_cr1) . . . . . . . . . . . . . . . . . . 451 15.6.2 tim10/11/13/14 interrupt enable register (timx_dier) . . . . . . . . . . . 451 RM0033 contents doc id 15403 rev 3 15/1317 15.6.3 tim10/11/13/14 status register (timx_sr) . . . . . . . . . . . . . . . . . . . . . 452 15.6.4 tim10/11/13/14 event generation register (timx_egr) . . . . . . . . . . . 453 15.6.5 tim10/11/13/14 capture/compare mode register 1 (timx_ccmr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 15.6.6 tim10/11/13/14 capture/compare enable register (timx_ccer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 15.6.7 tim10/11/13/14 counter (timx_cnt) . . . . . . . . . . . . . . . . . . . . . . . . . 457 15.6.8 tim10/11/13/14 prescaler (timx_psc) . . . . . . . . . . . . . . . . . . . . . . . . 457 15.6.9 tim10/11/13/14 auto-reload register (timx_arr) . . . . . . . . . . . . . . . 457 15.6.10 tim10/11/13/14 capture/compare register 1 (timx_ccr1) . . . . . . . . 458 15.6.11 tim11 option register 1 (tim11_or) . . . . . . . . . . . . . . . . . . . . . . . . . . 458 15.6.12 tim10/11/13/14 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 16 basic timers (tim6&tim7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 16.1 tim6&tim7 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 16.2 tim6&tim7 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 16.3 tim6&tim7 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 16.3.1 time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 16.3.2 counting mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 16.3.3 clock source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 16.3.4 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 16.4 tim6&tim7 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466 16.4.1 tim6&tim7 control register 1 (timx_cr1) . . . . . . . . . . . . . . . . . . . . . 466 16.4.2 tim6&tim7 control register 2 (timx_cr2) . . . . . . . . . . . . . . . . . . . . . 467 16.4.3 tim6&tim7 dma/interrupt enable register (timx_dier) . . . . . . . . . . 467 16.4.4 tim6&tim7 status register (timx_sr) . . . . . . . . . . . . . . . . . . . . . . . . 468 16.4.5 tim6&tim7 event generation register (timx_egr) . . . . . . . . . . . . . . 468 16.4.6 tim6&tim7 counter (timx_cnt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 16.4.7 tim6&tim7 prescaler (timx_psc) . . . . . . . . . . . . . . . . . . . . . . . . . . . 469 16.4.8 tim6&tim7 auto-reload register (timx_arr) . . . . . . . . . . . . . . . . . . . 469 16.4.9 tim6&tim7 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 17 independent watchdog (iwdg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 17.1 iwdg introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 17.2 iwdg main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 17.3 iwdg functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 17.3.1 hardware watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 contents RM0033 16/1317 doc id 15403 rev 3 17.3.2 register access protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 17.3.3 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 17.4 iwdg registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 17.4.1 key register (iwdg_kr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 17.4.2 prescaler register (iwdg_pr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 17.4.3 reload register (iwdg_rlr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 17.4.4 status register (iwdg_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 17.4.5 iwdg register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 18 window watchdog (wwdg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 18.1 wwdg introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 18.2 wwdg main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 18.3 wwdg functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 18.4 how to program the watchdog timeout . . . . . . . . . . . . . . . . . . . . . . . . . . 478 18.5 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 18.6 wwdg registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 18.6.1 control register (wwdg_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 18.6.2 configuration register (wwdg_cfr) . . . . . . . . . . . . . . . . . . . . . . . . . 482 18.6.3 status register (wwdg_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 18.6.4 wwdg register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 19 cryptographic processor (cryp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 19.1 cryp introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 19.2 cryp main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 19.3 cryp functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485 19.3.1 des/tdes cryptographic core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485 19.3.2 aes cryptographic core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490 19.3.3 data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 19.3.4 initialization vectors - cryp_iv0...1(l/r) . . . . . . . . . . . . . . . . . . . . . . 499 19.3.5 cryp busy state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 19.3.6 procedure to perform an encryption or a decryption . . . . . . . . . . . . . . 502 19.3.7 context swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 19.4 cryp interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 19.5 cryp dma interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 19.6 cryp registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 19.6.1 cryp control register (cryp_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 RM0033 contents doc id 15403 rev 3 17/1317 19.6.2 cryp status register (cryp_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 19.6.3 cryp data input register (cryp_din) . . . . . . . . . . . . . . . . . . . . . . . . 509 19.6.4 cryp data output register (cryp_dout) . . . . . . . . . . . . . . . . . . . . . 510 19.6.5 cryp dma control register (cryp_dmacr) . . . . . . . . . . . . . . . . . . . 511 19.6.6 cryp interrupt mask set/clear register (cryp_imscr) . . . . . . . . . . . 511 19.6.7 cryp raw interrupt status register (cryp_risr) . . . . . . . . . . . . . . . . 512 19.6.8 cryp masked interrupt status register (cryp_misr) . . . . . . . . . . . . 512 19.6.9 cryp key registers (cryp_k0...3(l/r)r) . . . . . . . . . . . . . . . . . . . . . . 513 19.6.10 cryp initialization vector registers (cryp_iv0...1(l/r)r) . . . . . . . . . 515 19.6.11 cryp register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516 20 random number generator (rng ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 20.1 rng introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 20.2 rng main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 20.3 rng functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 20.3.1 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 20.3.2 error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 20.4 rng registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 20.4.1 rng control register (rng_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 20.4.2 rng status register (rng_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 20.4.3 rng data register (rng_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 20.4.4 rng register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 21 hash processor (hash) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 21.1 hash introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 21.2 hash main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 21.3 hash functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 21.3.1 duration of the processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 21.3.2 data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 21.3.3 message digest computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 21.3.4 message padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 21.3.5 hash operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 21.3.6 hmac operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 21.3.7 context swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 21.3.8 hash interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 21.4 hash registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 contents RM0033 18/1317 doc id 15403 rev 3 21.4.1 hash control register (hash_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 21.4.2 hash data input register (hash_din) . . . . . . . . . . . . . . . . . . . . . . . . 534 21.4.3 hash start register (hash_str) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 21.4.4 hash digest registers (hash_hr0...4) . . . . . . . . . . . . . . . . . . . . . . . 536 21.4.5 hash interrupt enable register (hash_imr) . . . . . . . . . . . . . . . . . . . 537 21.4.6 hash status register (hash_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 21.4.7 hash context swap registers (hash_csr0...50) . . . . . . . . . . . . . . . 539 21.4.8 hash register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 22 real-time clock (rtc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 22.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 22.2 rtc main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 22.3 rtc functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 22.3.1 clock and prescalers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 22.3.2 real-time clock and calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 22.3.3 programmable alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 22.3.4 periodic auto-wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 22.3.5 rtc initialization and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 22.3.6 reading the calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 22.3.7 resetting the rtc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 22.3.8 rtc reference clock detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 22.3.9 rtc coarse digital calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 22.3.10 time-stamp function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 22.3.11 tamper detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 22.3.12 calibration clock output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 22.3.13 alarm output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 22.4 rtc and low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 22.5 rtc interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 22.6 rtc registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 22.6.1 rtc time register (rtc_tr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 22.6.2 rtc date register (rtc_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555 22.6.3 rtc control register (rtc_cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556 22.6.4 rtc initialization and status register (rtc_isr) . . . . . . . . . . . . . . . . . 558 22.6.5 rtc prescaler register (rtc_prer) . . . . . . . . . . . . . . . . . . . . . . . . . 560 22.6.6 rtc wakeup timer register (rtc_wutr) . . . . . . . . . . . . . . . . . . . . . . 560 22.6.7 rtc calibration register (rtc_calibr) . . . . . . . . . . . . . . . . . . . . . . . 561 RM0033 contents doc id 15403 rev 3 19/1317 22.6.8 rtc alarm a register (rtc_alrmar) . . . . . . . . . . . . . . . . . . . . . . . . 562 22.6.9 rtc alarm b register (rtc_alrmbr) . . . . . . . . . . . . . . . . . . . . . . . . 563 22.6.10 rtc write protection register (rtc_wpr) . . . . . . . . . . . . . . . . . . . . . 565 22.6.11 rtc time stamp time register (rtc_tstr) . . . . . . . . . . . . . . . . . . . . 565 22.6.12 rtc time stamp date register (rtc_tsdr) . . . . . . . . . . . . . . . . . . . . 566 22.6.13 rtc tamper and alternate function configuration register (rtc_tafcr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 22.6.14 rtc backup registers (rtc_bkpxr) . . . . . . . . . . . . . . . . . . . . . . . . . 568 22.6.15 rtc register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 23 inter-integrated circuit (i 2 c) interface . . . . . . . . . . . . . . . . . . . . . . . . . 570 23.1 i 2 c introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 23.2 i 2 c main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 23.3 i 2 c functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571 23.3.1 mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571 23.3.2 i2c slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573 23.3.3 i2c master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 23.3.4 error conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579 23.3.5 sda/scl line control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 23.3.6 smbus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 23.3.7 dma requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584 23.3.8 packet error checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 23.4 i 2 c interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586 23.5 i 2 c debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588 23.6 i 2 c registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588 23.6.1 i 2 c control register 1 (i2c_cr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588 23.6.2 i 2 c control register 2 (i2c_cr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590 23.6.3 i 2 c own address register 1 (i2c_oar1) . . . . . . . . . . . . . . . . . . . . . . . 592 23.6.4 i 2 c own address register 2 (i2c_oar2) . . . . . . . . . . . . . . . . . . . . . . . 592 23.6.5 i 2 c data register (i2c_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 23.6.6 i 2 c status register 1 (i2c_sr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 23.6.7 i 2 c status register 2 (i2c_sr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 23.6.8 i 2 c clock control register (i2c_ccr) . . . . . . . . . . . . . . . . . . . . . . . . . 598 23.6.9 i 2 c trise register (i2c_trise) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599 23.6.10 i2c register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600 contents RM0033 20/1317 doc id 15403 rev 3 24 universal synchr onous asynchronous receiver transmitter (usart) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601 24.1 usart introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601 24.2 usart main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601 24.3 usart functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602 24.3.1 usart character description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 24.3.2 transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606 24.3.3 receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609 24.3.4 fractional baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613 24.3.5 usart receiver?s tolerance to clock deviation . . . . . . . . . . . . . . . . . . 621 24.3.6 multiprocessor communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 24.3.7 parity control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 24.3.8 lin (local interconnection network) mode . . . . . . . . . . . . . . . . . . . . . . 624 24.3.9 usart synchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626 24.3.10 single-wire half-duplex communication . . . . . . . . . . . . . . . . . . . . . . . . 628 24.3.11 smartcard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 24.3.12 irda sir endec block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 24.3.13 continuous communication using dma . . . . . . . . . . . . . . . . . . . . . . . . 633 24.3.14 hardware flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635 24.4 usart interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637 24.5 usart mode configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 24.6 usart registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 24.6.1 status register (usart_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 24.6.2 data register (usart_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 24.6.3 baud rate register (usart_brr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 24.6.4 control register 1 (usart_cr1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 24.6.5 control register 2 (usart_cr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644 24.6.6 control register 3 (usart_cr3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645 24.6.7 guard time and prescaler register (usart_gtpr) . . . . . . . . . . . . . . 648 24.6.8 usart register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649 25 serial peripheral interface (spi ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650 25.1 spi introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650 25.2 spi and i 2 s main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 25.2.1 spi features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 25.2.2 i 2 s features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652 RM0033 contents doc id 15403 rev 3 21/1317 25.3 spi functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 25.3.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 25.3.2 configuring the spi in slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656 25.3.3 configuring the spi in master mode . . . . . . . . . . . . . . . . . . . . . . . . . . 659 25.3.4 configuring the spi for simplex communication . . . . . . . . . . . . . . . . . 661 25.3.5 data transmission and reception procedures . . . . . . . . . . . . . . . . . . . 661 25.3.6 crc calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668 25.3.7 status flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670 25.3.8 disabling the spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 25.3.9 spi communication using dma (direct memory addressing) . . . . . . . 672 25.3.10 error flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 25.3.11 spi interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 25.4 i 2 s functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676 25.4.1 i 2 s general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676 25.4.2 supported audio protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677 25.4.3 clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 25.4.4 i 2 s master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 25.4.5 i 2 s slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688 25.4.6 status flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690 25.4.7 error flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 25.4.8 i 2 s interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 25.4.9 dma features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692 25.5 spi and i 2 s registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693 25.5.1 spi control register 1 (spi_cr1) (not used in i 2 s mode) . . . . . . . . . . 693 25.5.2 spi control register 2 (spi_cr2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696 25.5.3 spi status register (spi_sr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 25.5.4 spi data register (spi_dr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 25.5.5 spi crc polynomial register (spi_crcpr) (not used in i 2 s mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 25.5.6 spi rx crc register ( spi_rxcrcr) (not used in i 2 s mode) . . . . . . 698 25.5.7 spi tx crc register (s pi_txcrcr) (not used in i 2 s mode) . . . . . . 699 25.5.8 spi_i 2 s configuration register (spi_i2scfgr) . . . . . . . . . . . . . . . . . . 699 25.5.9 spi_i 2 s prescaler register (spi_i2spr) . . . . . . . . . . . . . . . . . . . . . . . 701 25.5.10 spi register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 26 secure digital input/o utput interface (sdio) . . . . . . . . . . . . . . . . . . . . 703 26.1 sdio main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 contents RM0033 22/1317 doc id 15403 rev 3 26.2 sdio bus topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 26.3 sdio functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 26.3.1 sdio adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 26.3.2 sdio apb2 interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 26.4 card functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718 26.4.1 card identification mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718 26.4.2 card reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718 26.4.3 operating voltage range validation . . . . . . . . . . . . . . . . . . . . . . . . . . . 718 26.4.4 card identification process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719 26.4.5 block write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 26.4.6 block read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 26.4.7 stream access, stream write and stream read (multimediacard only) 721 26.4.8 erase: group erase and sector erase . . . . . . . . . . . . . . . . . . . . . . . . . . 722 26.4.9 wide bus selection or deselection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723 26.4.10 protection management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723 26.4.11 card status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726 26.4.12 sd status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729 26.4.13 sd i/o mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733 26.4.14 commands and responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734 26.5 response formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737 26.5.1 r1 (normal response command) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 26.5.2 r1b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 26.5.3 r2 (cid, csd register) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 26.5.4 r3 (ocr register) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 26.5.5 r4 (fast i/o) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 26.5.6 r4b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 26.5.7 r5 (interrupt request) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740 26.5.8 r6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 26.6 sdio i/o card-specifi c operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 26.6.1 sdio i/o read wait oper ation by sdio_d2 signalling . . . . . . . . . . . . . 741 26.6.2 sdio read wait operation by stopping sdio_ck . . . . . . . . . . . . . . . . 742 26.6.3 sdio suspend/resume operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 26.6.4 sdio interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 26.7 ce-ata specific operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 26.7.1 command completion signal disable . . . . . . . . . . . . . . . . . . . . . . . . . . 742 26.7.2 command completion signal enable . . . . . . . . . . . . . . . . . . . . . . . . . . 743 RM0033 contents doc id 15403 rev 3 23/1317 26.7.3 ce-ata interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743 26.7.4 aborting cmd61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743 26.8 hw flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743 26.9 sdio registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743 26.9.1 sdio power control register (sdio_power) . . . . . . . . . . . . . . . . . . . 744 26.9.2 sdi clock control register (sdio_clkcr) . . . . . . . . . . . . . . . . . . . . . . 744 26.9.3 sdio argument register (sdio_arg) . . . . . . . . . . . . . . . . . . . . . . . . . 745 26.9.4 sdio command register (sdio_cmd) . . . . . . . . . . . . . . . . . . . . . . . . 746 26.9.5 sdio command re sponse register (sdio_respcmd) . . . . . . . . . . . 747 26.9.6 sdio response 1..4 regi ster (sdio_respx) . . . . . . . . . . . . . . . . . . . 747 26.9.7 sdio data timer register (sdio_dtimer) . . . . . . . . . . . . . . . . . . . . . 748 26.9.8 sdio data length register (sdio_dlen) . . . . . . . . . . . . . . . . . . . . . . 748 26.9.9 sdio data control register (sdio_dctrl) . . . . . . . . . . . . . . . . . . . . . 749 26.9.10 sdio data counter register (sdio_dcount) . . . . . . . . . . . . . . . . . . 750 26.9.11 sdio status register (sdio_sta) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751 26.9.12 sdio interrupt clear register (sdio_icr) . . . . . . . . . . . . . . . . . . . . . . 752 26.9.13 sdio mask register (sdio_mask) . . . . . . . . . . . . . . . . . . . . . . . . . . . 754 26.9.14 sdio fifo counter register (sdio_fifocnt) . . . . . . . . . . . . . . . . . . 756 26.9.15 sdio data fifo register (sdio_fifo) . . . . . . . . . . . . . . . . . . . . . . . . 757 26.9.16 sdio register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757 27 controller area netwo rk (bxcan) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759 27.1 bxcan introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759 27.2 bxcan main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759 27.3 bxcan general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760 27.3.1 can 2.0b active core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760 27.3.2 control, status and configuration registers . . . . . . . . . . . . . . . . . . . . . 760 27.3.3 tx mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760 27.3.4 acceptance filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 27.4 bxcan operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762 27.4.1 initialization mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763 27.4.2 normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763 27.4.3 sleep mode (low power) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763 27.5 test mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 27.5.1 silent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 27.5.2 loop back mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 contents RM0033 24/1317 doc id 15403 rev 3 27.5.3 loop back combined with silent mode . . . . . . . . . . . . . . . . . . . . . . . . . 765 27.6 stm32f20x and stm32f21x in debug mode . . . . . . . . . . . . . . . . . . . . 766 27.7 bxcan functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 27.7.1 transmission handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 27.7.2 time triggered communication mode . . . . . . . . . . . . . . . . . . . . . . . . . 768 27.7.3 reception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768 27.7.4 identifier filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769 27.7.5 message storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 27.7.6 error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775 27.7.7 bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775 27.8 bxcan interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777 27.9 can registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 27.9.1 register access protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 27.9.2 can control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 27.9.3 can mailbox registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 27.9.4 can filter registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796 27.9.5 bxcan register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800 28 ethernet (eth): media access control (mac) with dma controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803 28.1 ethernet introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803 28.2 ethernet main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803 28.2.1 mac core features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804 28.2.2 dma features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805 28.2.3 ptp features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805 28.3 ethernet pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806 28.4 ethernet functional description: smi, mii and rmii . . . . . . . . . . . . . . . . 807 28.4.1 station management interface: smi . . . . . . . . . . . . . . . . . . . . . . . . . . . 807 28.4.2 media-independent interface: mii . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810 28.4.3 reduced media-independent interface: rmii . . . . . . . . . . . . . . . . . . . 812 28.4.4 mii/rmii selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813 28.5 ethernet functional description: mac 802.3 . . . . . . . . . . . . . . . . . . . . . . 814 28.5.1 mac 802.3 frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815 28.5.2 mac frame transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818 28.5.3 mac frame reception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 28.5.4 mac interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830 RM0033 contents doc id 15403 rev 3 25/1317 28.5.5 mac filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831 28.5.6 mac loopback mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834 28.5.7 mac management counters: mmc . . . . . . . . . . . . . . . . . . . . . . . . . . . 834 28.5.8 power management: pmt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835 28.5.9 precision time protocol (ieee1588 ptp) . . . . . . . . . . . . . . . . . . . . . . . 838 28.6 ethernet functional description: dma controller operation . . . . . . . . . . . 844 28.6.1 initialization of a transfer using dma . . . . . . . . . . . . . . . . . . . . . . . . . . 845 28.6.2 host bus burst access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845 28.6.3 host data buffer alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846 28.6.4 buffer size calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846 28.6.5 dma arbiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847 28.6.6 error response to dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847 28.6.7 tx dma configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847 28.6.8 rx dma configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858 28.6.9 dma interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870 28.7 ethernet interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871 28.8 ethernet register descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872 28.8.1 mac register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872 28.8.2 mmc register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892 28.8.3 ieee 1588 time stamp registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898 28.8.4 dma register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905 28.8.5 ethernet register maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 920 29 usb on-the-go full-speed (otg_fs) . . . . . . . . . . . . . . . . . . . . . . . . . . 924 29.1 otg_fs introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924 29.2 otg_fs main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925 29.2.1 general features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925 29.2.2 host-mode features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 926 29.2.3 peripheral-mode features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 926 29.3 otg_fs functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927 29.3.1 otg full-speed core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927 29.3.2 full-speed otg phy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927 29.4 otg dual role device (drd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928 29.4.1 id line detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929 29.4.2 hnp dual role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929 29.4.3 srp dual role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929 contents RM0033 26/1317 doc id 15403 rev 3 29.5 usb peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930 29.5.1 srp-capable peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930 29.5.2 peripheral states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931 29.5.3 peripheral endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932 29.6 usb host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934 29.6.1 srp-capable host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935 29.6.2 usb host states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935 29.6.3 host channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 936 29.6.4 host scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938 29.7 sof trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939 29.7.1 host sofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939 29.7.2 peripheral sofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939 29.8 power options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 940 29.9 dynamic update of the otg_fs_hfir register . . . . . . . . . . . . . . . . . . . 941 29.10 usb data fifos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941 29.11 peripheral fifo architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 942 29.11.1 peripheral rx fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 942 29.11.2 peripheral tx fifos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 943 29.12 host fifo architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 943 29.12.1 host rx fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 943 29.12.2 host tx fifos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944 29.13 fifo ram allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944 29.13.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944 29.13.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945 29.14 usb system performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945 29.15 otg_fs interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946 29.16 otg_fs control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 948 29.16.1 csr memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949 29.16.2 otg_fs global registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953 29.16.3 host-mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 975 29.16.4 device-mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986 29.16.5 otg_fs power and clock gating control register (otg_fs_pcgcctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008 29.16.6 otg_fs register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009 29.17 otg_fs programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015 29.17.1 core initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015 RM0033 contents doc id 15403 rev 3 27/1317 29.17.2 host initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1017 29.17.3 device initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1017 29.17.4 host programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1018 29.17.5 device programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1035 29.17.6 operational model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1037 29.17.7 worst case response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1054 29.17.8 otg programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1055 30 usb on-the-go high-speed (otg_h s) . . . . . . . . . . . . . . . . . . . . . . . . 1062 30.1 otg_hs introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1062 30.2 otg_hs main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063 30.2.1 general features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063 30.2.2 host-mode features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064 30.2.3 peripheral-mode features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064 30.3 otg_hs functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065 30.3.1 high-speed otg phy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065 30.3.2 external full-speed otg phy using the i2c interface . . . . . . . . . . . 1065 30.3.3 embedded full-speed otg phy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065 30.4 otg dual-role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1066 30.4.1 id line detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1066 30.4.2 hnp dual role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1066 30.4.3 srp dual-role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1066 30.5 usb functional description in peripheral mode . . . . . . . . . . . . . . . . . . 1067 30.5.1 srp-capable peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067 30.5.2 peripheral states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067 30.5.3 peripheral endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1068 30.6 usb functional description on host mode . . . . . . . . . . . . . . . . . . . . . . 1071 30.6.1 srp-capable host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1071 30.6.2 usb host states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1071 30.6.3 host channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1073 30.6.4 host scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074 30.7 sof trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075 30.7.1 host sofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075 30.7.2 peripheral sofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075 30.8 usb_hs power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1076 30.9 dynamic update of the otg_hs_hfir register . . . . . . . . . . . . . . . . . 1077 contents RM0033 28/1317 doc id 15403 rev 3 30.10 fifo ram allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077 30.10.1 peripheral mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077 30.10.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078 30.11 otg_hs interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078 30.12 otg_hs control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . 1080 30.12.1 csr memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080 30.12.2 otg_hs global registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085 30.12.3 host-mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1110 30.12.4 device-mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1122 30.12.5 otg_hs power and clock gating control register (otg_hs_pcgcctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1149 30.12.6 otg_hs register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1150 30.13 otg_hs programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1162 30.13.1 core initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1162 30.13.2 host initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1163 30.13.3 device initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1164 30.13.4 dma mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1164 30.13.5 host programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1164 30.13.6 device programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1192 30.13.7 operational model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1194 30.13.8 worst case response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1211 30.13.9 otg programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 31 flexible static memory controller (fsmc) . . . . . . . . . . . . . . . . . . . . 1219 31.1 fsmc main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1219 31.2 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1220 31.3 ahb interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1220 31.3.1 supported memories and transactions . . . . . . . . . . . . . . . . . . . . . . . 1221 31.4 external device address mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222 31.4.1 nor/psram address mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222 31.4.2 nand/pc card address mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 1223 31.5 nor flash/psram controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1224 31.5.1 external memory interface signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 1225 31.5.2 supported memories and transactions . . . . . . . . . . . . . . . . . . . . . . . 1227 31.5.3 general timing rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1228 31.5.4 nor flash/psram controller asynchronous transactions . . . . . . . . 1228 RM0033 contents doc id 15403 rev 3 29/1317 31.5.5 synchronous burst transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1245 31.5.6 nor/psram controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1251 31.6 nand flash/pc card controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1256 31.6.1 external memory interface signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257 31.6.2 nand flash / pc card supported me mories and transactions . . . . . 1259 31.6.3 timing diagrams for nand and pc card . . . . . . . . . . . . . . . . . . . . . 1259 31.6.4 nand flash operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1260 31.6.5 nand flash pre-wait functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . 1261 31.6.6 error correction code computation ecc (nand flash) . . . . . . . . . . . 1262 31.6.7 pc card/compactflash operations . . . . . . . . . . . . . . . . . . . . . . . . . . 1262 31.6.8 nand flash/pc card controller registers . . . . . . . . . . . . . . . . . . . . . 1265 31.6.9 fsmc register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271 32 debug support (dbg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1273 32.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1273 32.2 reference arm documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274 32.3 swj debug port (serial wire and jtag) . . . . . . . . . . . . . . . . . . . . . . . . 1274 32.3.1 mechanism to select the jtag-dp or the sw-dp . . . . . . . . . . . . . . . 1275 32.4 pinout and debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1275 32.4.1 swj debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276 32.4.2 flexible swj-dp pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276 32.4.3 internal pull-up and pull-down on jtag pins . . . . . . . . . . . . . . . . . . . 1277 32.4.4 using serial wire and releasing the unused debug pins as gpios . . 1278 32.5 stm32f20x and stm32f21x jtag tap connection . . . . . . . . . . . . . 1278 32.6 id codes and locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279 32.6.1 mcu device id code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279 32.6.2 boundary scan tap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1280 32.6.3 cortex-m3 tap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1280 32.6.4 cortex-m3 jedec-106 id code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1280 32.7 jtag debug port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1280 32.8 sw debug port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1282 32.8.1 sw protocol introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1282 32.8.2 sw protocol sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1282 32.8.3 sw-dp state machine (reset, idle states, id code) . . . . . . . . . . . . . . 1283 32.8.4 dp and ap read/write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1284 32.8.5 sw-dp registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1284 contents RM0033 30/1317 doc id 15403 rev 3 32.8.6 sw-ap registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1285 32.9 ahb-ap (ahb access port) - valid for both jtag-dp and sw-dp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1285 32.10 core debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286 32.11 capability of the debugger host to connect under system reset . . . . . 1287 32.12 fpb (flash patch breakpoint) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1287 32.13 dwt (data watchpoint trigger) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1288 32.14 itm (instrumentation trace macrocell) . . . . . . . . . . . . . . . . . . . . . . . . . 1288 32.14.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1288 32.14.2 time stamp packets, synchronization and overflow packets . . . . . . . 1288 32.15 etm (embedded trace macrocell) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1290 32.15.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1290 32.15.2 signal protocol, packet types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1290 32.15.3 main etm registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291 32.15.4 configuration example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291 32.16 mcu debug component (dbgmcu) . . . . . . . . . . . . . . . . . . . . . . . . . . 1291 32.16.1 debug support for low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . 1291 32.16.2 debug support for timers, watchdog, bxcan and i 2 c . . . . . . . . . . . . 1292 32.16.3 debug mcu configuration register . . . . . . . . . . . . . . . . . . . . . . . . . . . 1292 32.16.4 debug mcu apb1 freeze register (dbgmcu_apb1_fz) . . . . . . . . 1293 32.16.5 debug mcu apb2 freeze register (dbgmcu_apb2_fz) . . . . . . . . 1295 32.17 tpiu (trace port interface unit) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296 32.17.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296 32.17.2 trace pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296 32.17.3 tpui formatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1298 32.17.4 tpui frame synchronization packets . . . . . . . . . . . . . . . . . . . . . . . . . 1298 32.17.5 transmission of the synchronization frame packet . . . . . . . . . . . . . . 1299 32.17.6 synchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299 32.17.7 asynchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299 32.17.8 traceclkin connection inside the stm32f20x and stm32f21x . 1299 32.17.9 tpiu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1301 32.17.10 example of configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1302 32.18 dbg register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1302 33 device electronic signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1303 33.1 unique device id register (96 bits) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1303 RM0033 contents doc id 15403 rev 3 31/1317 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1309 list of tables RM0033 32/1317 doc id 15403 rev 3 list of tables table 1. stm32f20x and stm32f21x register boundary addresses . . . . . . . . . . . . . . . . . . . . . . . 50 table 2. flash module organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 table 3. number of wait states according to cortex-m3 clock frequency. . . . . . . . . . . . . . . . . . . . . 55 table 4. boot modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 table 5. memory mapping vs. boot mode/physical remap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 table 6. crc calculation unit register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 table 7. low-power mode summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 table 8. sleep-now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 table 9. sleep-on-exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 table 10. stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 table 11. standby mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 table 12. pwr - register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0 table 13. rcc register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2 table 14. port bit configuration table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 table 15. flexible swj-dp pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7 table 16. rtc_af1 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 table 17. rtc_af2 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 table 18. gpio register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 table 19. syscfg register map an d reset values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 table 20. vector table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 table 21. external interrupt/event controller register map and reset values. . . . . . . . . . . . . . . . . . . 169 table 22. dma1 request mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 table 23. dma2 request mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 table 24. source and destination address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 table 25. source and destination address registers in double buffer mode (dbm=1). . . . . . . . . . . 181 table 26. packing/unpacking & endian behavior (bit pinc = minc = 1) . . . . . . . . . . . . . . . . . . . . . 182 table 27. restriction on ndt versus psize and msize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 table 28. fifo threshold configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 table 29. possible dma configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 table 30. dma interrupt requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 table 31. dma register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 table 32. adc pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 table 33. analog watchdog channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 table 34. configuring the trigger polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 table 35. external trigger for regular channels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 table 36. external trigger for injected channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 table 37. adc interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 table 38. adc global register map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 table 39. adc register map and reset values for each adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 table 40. adc register map and reset values (common adc registers) . . . . . . . . . . . . . . . . . . . . . 247 table 41. dac pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 table 42. external triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 table 43. dac register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 table 44. dcmi pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 table 45. dcmi signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 table 46. positioning of captured data bytes in 32-bit words (8-bit width) . . . . . . . . . . . . . . . . . . . . 272 table 47. positioning of captured data bytes in 32-bit words (10-bit width) . . . . . . . . . . . . . . . . . . . 272 table 48. positioning of captured data bytes in 32-bit words (12-bit width) . . . . . . . . . . . . . . . . . . . 272 RM0033 list of tables doc id 15403 rev 3 33/1317 table 49. positioning of captured data bytes in 32-bit words (14-bit width) . . . . . . . . . . . . . . . . . . . 273 table 50. data storage in monochrome progressive video format . . . . . . . . . . . . . . . . . . . . . . . . . . 278 table 51. data storage in rgb progressive video format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 table 52. data storage in ycbcr progressive video format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 table 53. dcmi interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 table 54. dcmi register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 table 55. counting direction versus encoder signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 table 56. timx internal trigger connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 table 57. output control bits for complementary ocx and ocxn channels with break feature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 table 58. tim1&tim8 register map and reset values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 table 59. counting direction versus encoder signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 table 60. timx internal trigger connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 table 61. output control bit for standard ocx channels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 table 62. tim2 to tim5 register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 table 63. timx internal trigger connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 table 64. output control bit for standard ocx channels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 table 65. tim9/12 register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 table 66. output control bit for standard ocx channels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 table 67. tim10/11/13/14 register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 table 68. tim6&tim7 register map and reset values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 table 69. min/max iwdg timeout period at 32 khz (lsi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 table 70. iwdg register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 table 71. timeout values at 30 mhz (f pclk1 ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 table 72. wwdg register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 table 73. data types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 table 74. cryp register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516 table 75. rng register map and reset map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2 table 76. hash register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 table 77. effect of low power modes on rtc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 table 78. interrupt control bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553 table 79. rtc register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 8 table 80. smbus vs. i2c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 table 81. i2c interrupt requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586 table 82. i2c register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600 table 83. noise detection from sampled data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 2 table 84. error calculation for programmed baud rates at f pclk = 8 mhz or f pclk = 12 mhz), oversampling by 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 15 table 85. error calculation for programmed baud rates at f pclk = 8 mhz or f pclk =12 mhz), oversampling by 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 table 86. error calculation for programmed baud rates at f pclk = 16 mhz or f pclk = 24 mhz), oversampling by 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 16 table 87. error calculation for programmed baud rates at f pclk = 16 mhz or f pclk = 24 mhz), oversampling by 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617 table 88. error calculation for programmed baud rates at fpclk = 8 mhz or fpclk = 16 mhz), oversampling by 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 18 table 89. error calculation for programmed baud rates at fpclk = 8 mhz or fpclk = 16 mhz), oversampling by 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 table 90. error calculation for programmed baud rates at fpclk = 30 mhz or fpclk = 60 mhz), oversampling by 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 19 table 91. error calculation for programmed baud rates at fpclk = 30 mhz or fpclk = 60 mhz), oversampling by 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620 list of tables RM0033 34/1317 doc id 15403 rev 3 table 92. usart receiver?s tolerance when div fraction is 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 table 93. usart receiver?s tolerance when div_fraction is different from 0 . . . . . . . . . . . . . . . . . 621 table 94. frame formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 table 95. usart interrupt requests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637 table 96. usart mode configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 table 97. usart register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649 table 98. spi interrupt requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 table 99. audio frequency precision (for pllm vco = 1 mhz or 2 mhz) . . . . . . . . . . . . . . . . . . . . 686 table 100. i 2 s interrupt requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 2 table 101. spi register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 table 102. sdio i/o definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 table 103. command format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 table 104. short response format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 table 105. long response format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 table 106. command path status flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 table 107. data token format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715 table 108. transmit fifo status flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 table 109. receive fifo status flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 table 110. card status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727 table 111. sd status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729 table 112. speed class code field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 table 113. performance move field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 table 114. au_size field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 table 115. maximum au size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 table 116. erase size field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 table 117. erase timeout field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 table 118. erase offset field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733 table 119. block-oriented write commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735 table 120. block-oriented write protection commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736 table 121. erase commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736 table 122. i/o mode commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736 table 123. lock card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737 table 124. application-specific commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737 table 125. r1 response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 table 126. r2 response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 table 127. r3 response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 table 128. r4 response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 table 129. r4b response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 table 130. r5 response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740 table 131. r6 response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 table 132. response type and sd io_respx registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 table 133. sdio register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757 table 134. transmit mailbox mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774 table 135. receive mailbox mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774 table 136. bxcan register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800 table 137. alternate function mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806 table 138. management frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808 table 139. clock range. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810 table 140. tx interface signal encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811 table 141. rx interface signal encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811 table 142. frame statuses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827 table 143. destination address filtering table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833 RM0033 list of tables doc id 15403 rev 3 35/1317 table 144. source address filtering table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834 table 145. receive descriptor 0 - encoding for bits 7, 5 and 0 (normal descriptor format only, edfe=0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863 table 147. ethernet register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 0 table 148. core global control and status registers (csrs). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949 table 149. host-mode control and status registers (csrs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 950 table 150. device-mode control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951 table 151. data fifo (dfifo) access register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953 table 152. power and clock gating control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953 table 153. minimum duration for soft disconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 88 table 154. otg_fs register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009 table 155. core global control and status registers (csrs). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1081 table 156. host-mode control and status registers (csrs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1082 table 157. device-mode control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083 table 158. data fifo (dfifo) access register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085 table 159. power and clock gating control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085 table 160. minimum duration for soft disconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5 table 161. otg_hs register map and reset values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1150 table 162. nor/psram bank selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 22 table 163. external memory address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1223 table 164. memory mapping and timing registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1223 table 165. nand bank selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1223 table 166. programmable nor/psram access parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1224 table 167. nonmultipled i/o nor flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1225 table 168. multiplexed i/o nor flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1225 table 169. nonmultiplexed i/os psram/sram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1226 table 170. multiplexed i/o psram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1227 table 171. nor flash/psram supported memories and transactions . . . . . . . . . . . . . . . . . . . . . . 1227 table 172. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230 table 173. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230 table 174. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1232 table 175. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1232 table 176. fsmc_bwtrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1232 table 177. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1235 table 178. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1235 table 179. fsmc_bwtrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1235 table 180. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1237 table 181. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238 table 182. fsmc_bwtrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238 table 183. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1240 table 184. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1240 table 185. fsmc_bwtrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1240 table 186. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1242 table 187. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1242 table 188. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1247 table 189. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1248 table 190. fsmc_bcrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1250 table 191. fsmc_btrx bit fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1250 table 192. programmable nand/pc card access parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257 table 193. 8-bit nand flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257 table 194. 16-bit nand flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258 table 195. 16-bit pc card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258 list of tables RM0033 36/1317 doc id 15403 rev 3 table 196. supported memories and transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1259 table 197. 16-bit pc-card signals and access type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263 table 198. ecc result relevant bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1270 table 199. fsmc register map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271 table 200. swj debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276 table 201. flexible swj-dp pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 6 table 202. jtag debug port data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1280 table 203. 32-bit debug port registers addressed through the shifted value a[3:2] . . . . . . . . . . . . . 1281 table 204. packet request (8-bits) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1282 table 205. ack response (3 bits). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1283 table 206. data transfer (33 bits) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1283 table 207. sw-dp registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1284 table 208. cortex-m3 ahb-ap registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286 table 209. core debug registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286 table 210. main itm registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1289 table 211. main etm registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291 table 212. asynchronous trace pin assignment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296 table 213. synchronous trace pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1297 table 214. flexible trace pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 97 table 215. important tpiu registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1301 table 216. dbg register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 2 table 217. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1309 RM0033 list of figures doc id 15403 rev 3 37/1317 list of figures figure 1. system architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 figure 2. crc calculation unit block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 figure 3. power supply overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 figure 4. backup sram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 figure 5. power-on reset/power-down reset waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 figure 6. bor thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 figure 7. pvd thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 figure 8. simplified diagram of the reset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 figure 9. clock tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 figure 10. hse/ lse clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 figure 11. frequency measurement with tim5 in input capture mode . . . . . . . . . . . . . . . . . . . . . . . . 91 figure 12. frequency measurement with tim11 in input capture mode . . . . . . . . . . . . . . . . . . . . . . . 91 figure 13. basic structure of a five-volt tolerant i/o port bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 35 figure 14. selecting an alternate function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 figure 15. input floating/pull up/pull down configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 figure 16. output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 figure 17. alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 figure 18. high impedance-analog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 figure 19. external interrupt/event controller block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 figure 20. external interrupt/event gpio mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 figure 21. dma block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 figure 22. system implementation of two dma controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 figure 23. channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 figure 24. peripheral-to-memory mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 figure 25. memory-to-peripheral mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 figure 26. memory-to-memory mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 figure 27. fifo structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 figure 28. single adc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 figure 29. timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 figure 30. analog watchdog?s guarded area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 09 figure 31. injected conversion latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 figure 32. right alignment of 12-bit data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 figure 33. left alignment of 12-bit data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 figure 34. left alignment of 6-bit data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 figure 35. multi adc block diagram (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 figure 36. injected simultaneous mode on 4 channels: dual adc mode . . . . . . . . . . . . . . . . . . . . . 221 figure 37. injected simultaneous mode on 4 channels: triple adc mode . . . . . . . . . . . . . . . . . . . . . 221 figure 38. regular simultaneous mode on 16 channels: dual adc mode . . . . . . . . . . . . . . . . . . . . 222 figure 39. regular simultaneous mode on 16 channels: triple adc mode . . . . . . . . . . . . . . . . . . . . 222 figure 40. interleaved mode on 1 channel in contin uous conversion mode: dual adc mode. . . . . . 223 figure 41. interleaved mode on 1 channel in continuous conversion mode: triple adc mode . . . . . 224 figure 42. alternate trigger: injected group of each adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 figure 43. alternate trigger: 4 injected channels (each adc) in discontinuous mode . . . . . . . . . . . . 225 figure 44. alternate trigger: injected group of each adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 figure 45. alternate + regular simultaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 figure 46. case of trigger occurring during injected conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 figure 47. temperature sensor and vrefint channel block diagram . . . . . . . . . . . . . . . . . . . . . . 228 figure 48. dac channel block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 list of figures RM0033 38/1317 doc id 15403 rev 3 figure 49. data registers in single dac channel mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 figure 50. data registers in dual dac channel mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 figure 51. timing diagram for conversion with trigger disabled ten = 0 . . . . . . . . . . . . . . . . . . . . . 251 figure 52. dac lfsr register calculation algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 figure 53. dac conversion (sw trigger enabled) with lfsr wave generation. . . . . . . . . . . . . . . . . 254 figure 54. dac triangle wave generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 figure 55. dac conversion (sw trigger enabled) with triangle wave generation . . . . . . . . . . . . . . . 255 figure 56. dcmi block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 figure 57. top-level block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 figure 58. dcmi signal waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 figure 59. timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 figure 60. frame capture waveforms in snapshot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 figure 61. frame capture waveforms in continuous grab mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 figure 62. coordinates and size of the window after cropping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 figure 63. data capture waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 figure 64. pixel raster scan order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 figure 65. advanced-control timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 figure 66. counter timing diagram with prescaler division change from 1 to 2 . . . . . . . . . . . . . . . . . 294 figure 67. counter timing diagram with prescaler division change from 1 to 4 . . . . . . . . . . . . . . . . . 294 figure 68. counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 figure 69. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 figure 70. counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 figure 71. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 figure 72. counter timing diagram, update even t when arpe=0 (timx_arr not preloaded) . . . . . 296 figure 73. counter timing diagram, update event when arpe=1 (timx_arr preloaded) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 figure 74. counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 figure 75. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 figure 76. counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 figure 77. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 figure 78. counter timing diagram, update event when repetition counter is not used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 figure 79. counter timing diagram, internal clock divided by 1, timx_arr = 0x6 . . . . . . . . . . . . . . 300 figure 80. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 figure 81. counter timing diagram, internal clock divided by 4, timx_arr=0x36 . . . . . . . . . . . . . . 301 figure 82. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 figure 83. counter timing diagram, update event with arpe=1 (counter underflow) . . . . . . . . . . . . 302 figure 84. counter timing diagram, update event with arpe=1 (counter overflow) . . . . . . . . . . . . . 302 figure 85. update rate examples depending on mode and timx_rcr register settings . . . . . . . . . 303 figure 86. control circuit in normal mode, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . 304 figure 87. ti2 external clock connection example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4 figure 88. control circuit in external clock mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 figure 89. external trigger input block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 figure 90. control circuit in external clock mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 figure 91. capture/compare channel (example: channel 1 input stage) . . . . . . . . . . . . . . . . . . . . . . 307 figure 92. capture/compare channel 1 main circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 figure 93. output stage of capture/compare channel (channel 1 to 3) . . . . . . . . . . . . . . . . . . . . . . . 308 figure 94. output stage of capture/compare channel (channel 4). . . . . . . . . . . . . . . . . . . . . . . . . . . 308 figure 95. pwm input mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 figure 96. output compare mode, toggle on oc1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 figure 97. edge-aligned pwm waveforms (arr=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 figure 98. center-aligned pwm waveforms (arr=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 RM0033 list of figures doc id 15403 rev 3 39/1317 figure 99. complementary output with dead-time insertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 figure 100. dead-time waveforms with delay greater than the negative pulse. . . . . . . . . . . . . . . . . . 315 figure 101. dead-time waveforms with delay greater than the positive pulse. . . . . . . . . . . . . . . . . . . 316 figure 102. output behavior in response to a break.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 18 figure 103. clearing timx ocxref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 figure 104. 6-step generation, com example (ossr=1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 figure 105. example of one pulse mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 figure 106. example of counter operation in encoder interface mode. . . . . . . . . . . . . . . . . . . . . . . . . 324 figure 107. example of encoder interface mode with ti1fp1 polarity inverted. . . . . . . . . . . . . . . . . . 324 figure 108. example of hall sensor interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 figure 109. control circuit in reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 figure 110. control circuit in gated mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 figure 111. control circuit in trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 figure 112. control circuit in external clock mode 2 + trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . 330 figure 113. general-purpose timer block diagram (tim2 to tim5) . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 figure 114. counter timing diagram with prescaler division change from 1 to 2 . . . . . . . . . . . . . . . . . 360 figure 115. counter timing diagram with prescaler division change from 1 to 4 . . . . . . . . . . . . . . . . . 361 figure 116. counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 figure 117. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 figure 118. counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 figure 119. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 figure 120. counter timing diagram, update event when arpe=0 (timx_arr not preloaded). . . . . 363 figure 121. counter timing diagram, update event when arpe=1 (timx_arr preloaded). . . . . . . . 364 figure 122. counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 figure 123. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 figure 124. counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 figure 125. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 figure 126. counter timing diagram, update event when repetition counter is not used . . . . . . . . . . 366 figure 127. counter timing diagram, internal clock divided by 1, timx_arr=0x6 . . . . . . . . . . . . . . . 367 figure 128. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 figure 129. counter timing diagram, internal clock divided by 4, timx_arr=0x36 . . . . . . . . . . . . . . 368 figure 130. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 figure 131. counter timing diagram, update event with arpe=1 (counter underflow). . . . . . . . . . . . 369 figure 132. counter timing diagram, update event with arpe=1 (counter overflow) . . . . . . . . . . . . . 369 figure 133. control circuit in normal mode, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . 370 figure 134. ti2 external clock connection example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 71 figure 135. control circuit in external clock mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 figure 136. external trigger input block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 figure 137. control circuit in external clock mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 figure 138. capture/compare channel (example: channel 1 input stage) . . . . . . . . . . . . . . . . . . . . . . 373 figure 139. capture/compare channel 1 main circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 figure 140. output stage of capture/compare channel (channel 1). . . . . . . . . . . . . . . . . . . . . . . . . . . 374 figure 141. pwm input mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 figure 142. output compare mode, toggle on oc1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 figure 143. edge-aligned pwm waveforms (arr=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 figure 144. center-aligned pwm waveforms (arr=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 figure 145. example of one-pulse mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 figure 146. clearing timx ocxref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 figure 147. example of counter operation in encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . 384 figure 148. example of encoder interface mode with ti1fp1 polarity inverted . . . . . . . . . . . . . . . . . 385 figure 149. control circuit in reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 figure 150. control circuit in gated mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 list of figures RM0033 40/1317 doc id 15403 rev 3 figure 151. control circuit in trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 figure 152. control circuit in external clock mode 2 + trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . 388 figure 153. master/slave timer example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 figure 154. gating timer 2 with oc1ref of timer 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 0 figure 155. gating timer 2 with enable of timer 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 figure 156. triggering timer 2 with update of timer 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 figure 157. triggering timer 2 with enable of timer 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 figure 158. triggering timer 1 and 2 with timer 1 ti1 input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 figure 159. general-purpose timer block diagram (tim9 and tim12) . . . . . . . . . . . . . . . . . . . . . . . . 419 figure 160. general-purpose timer block diagram (tim10/11/13/14) . . . . . . . . . . . . . . . . . . . . . . . . . 420 figure 161. counter timing diagram with prescaler division change from 1 to 2 . . . . . . . . . . . . . . . . . 422 figure 162. counter timing diagram with prescaler division change from 1 to 4 . . . . . . . . . . . . . . . . . 422 figure 163. counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 figure 164. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 figure 165. counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 figure 166. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 figure 167. counter timing diagram, update event when arpe=0 (timx_arr not preloaded). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 figure 168. counter timing diagram, update event when arpe=1 (timx_arr preloaded). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 figure 169. control circuit in normal mode, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . 426 figure 170. ti2 external clock connection example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 26 figure 171. control circuit in external clock mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 figure 172. capture/compare channel (example: channel 1 input stage) . . . . . . . . . . . . . . . . . . . . . . 427 figure 173. capture/compare channel 1 main circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 figure 174. output stage of capture/compare channel (channel 1). . . . . . . . . . . . . . . . . . . . . . . . . . . 428 figure 175. pwm input mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 figure 176. output compare mode, toggle on oc1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 figure 177. edge-aligned pwm waveforms (arr=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 figure 178. example of one pulse mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 figure 179. control circuit in reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 figure 180. control circuit in gated mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 figure 181. control circuit in trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 figure 182. basic timer block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 figure 183. counter timing diagram with prescaler division change from 1 to 2 . . . . . . . . . . . . . . . . . 462 figure 184. counter timing diagram with prescaler division change from 1 to 4 . . . . . . . . . . . . . . . . . 462 figure 185. counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 figure 186. counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 figure 187. counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 figure 188. counter timing diagram, internal clock divided by n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 figure 189. counter timing diagram, update event when arpe = 0 (timx_arr not preloaded). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 figure 190. counter timing diagram, update event when arpe=1 (timx_arr preloaded). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 figure 191. control circuit in normal mode, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . 465 figure 192. independent watchdog block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 figure 193. watchdog block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 figure 194. window watchdog timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 79 figure 195. block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485 figure 196. des/tdes-ecb mode encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 figure 197. des/tdes-ecb mode decryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 figure 198. des/tdes-cbc mode encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 RM0033 list of figures doc id 15403 rev 3 41/1317 figure 199. des/tdes-cbc mode decryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490 figure 200. aes-ecb mode encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 figure 201. aes-ecb mode decryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 figure 202. aes-cbc mode encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 figure 203. aes-cbc mode decryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494 figure 204. aes-ctr mode encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495 figure 205. aes-ctr mode encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 figure 206. initial counter block structure for the counter mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 figure 207. 64-bit block construction according to datatype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 figure 208. initialization vectors use in the tdes-cbc encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 figure 209. cryp interrupt mapping diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 figure 210. block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 figure 211. block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 figure 212. bit, byte and half-word swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 figure 213. hash interrupt mapping diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 figure 214. rtc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 figure 215. i2c bus protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572 figure 216. i2c block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572 figure 217. transfer sequence diagram for slave transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574 figure 218. transfer sequence diagram for slave receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 figure 219. transfer sequence diagram for master transmitter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577 figure 220. transfer sequence diagram for master receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579 figure 221. i2c interrupt mapping diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 figure 222. usart block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604 figure 223. word length programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 figure 224. configurable stop bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 figure 225. tc/txe behavior when transmitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 08 figure 226. start bit detection when oversampling by 16 or 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609 figure 227. data sampling when oversampling by 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612 figure 228. data sampling when oversampling by 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612 figure 229. mute mode using idle line detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 figure 230. mute mode using address mark detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 figure 231. break detection in lin mode (11-bit break length - lbdl bit is set) . . . . . . . . . . . . . . . . . 625 figure 232. break detection in lin mode vs. framing error detection. . . . . . . . . . . . . . . . . . . . . . . . . 626 figure 233. usart example of synchronous transmission. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 figure 234. usart data clock timing diagram (m=0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 figure 235. usart data clock timing diagram (m=1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 figure 236. rx data setup/hold time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 figure 237. iso 7816-3 asynchronous protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 29 figure 238. parity error detection using the 1.5 stop bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 30 figure 239. irda sir endec- block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 32 figure 240. irda data modulation (3/16) -normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 figure 241. transmission using dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 figure 242. reception using dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635 figure 243. hardware flow control between 2 usarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635 figure 244. rts flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 figure 245. cts flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 figure 246. usart interrupt mapping diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 37 figure 247. spi block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 figure 248. single master/ single slave application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654 figure 249. hardware/software slave select management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655 figure 250. data clock timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656 list of figures RM0033 42/1317 doc id 15403 rev 3 figure 251. ti mode - slave mode, single transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658 figure 252. ti mode - slave mode, continuous transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658 figure 253. ti mode - master mode, single transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 figure 254. ti mode - master mode, continuous transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660 figure 255. txe/rxne/bsy behavior in master / full-duplex mo de (bidimode=0 and rxonly=0) in the case of continuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664 figure 256. txe/rxne/bsy behavior in slave / fu ll-duplex mode (bidimode=0, rxonly=0) in the case of continuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664 figure 257. txe/bsy behavior in master transmit-only mode (bid imode=0 and rxonly=0) in the case of continuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 figure 258. txe/bsy in slave transmit-only mode (bidimode=0 and rxonly=0) in the case of continuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 66 figure 259. rxne behavior in receive-only mode (bidirmode=0 and rxonly=1) in the case of continuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 67 figure 260. txe/bsy behavior when transmitting (bidirmode=0 and rxonly=0) in the case of discontinuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 8 figure 261. transmission using dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673 figure 262. reception using dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673 figure 263. ti mode frame format error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 figure 264. i 2 s block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6 figure 265. i 2 s phillips protocol waveforms (16/32 -bit full accuracy, cp ol = 0) . . . . . . . . . . . . . . . . 678 figure 266. i 2 s phillips standard waveforms (24-bit frame with cpol = 0) . . . . . . . . . . . . . . . . . . . . 678 figure 267. transmitting 0x8eaa33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679 figure 268. receiving 0x8eaa33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679 figure 269. i 2 s phillips standard (16-bit extended to 32-bit pack et frame with cpol = 0) . . . . . . . . . 679 figure 270. example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680 figure 271. msb justified 16-bit or 32-bit full-accuracy length with cpol = 0 . . . . . . . . . . . . . . . . . . 680 figure 272. msb justified 24-bit frame length with cpol = 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681 figure 273. msb justified 16-bit extended to 32-bit packet frame with cpol = 0 . . . . . . . . . . . . . . . 681 figure 274. lsb justified 16-bit or 32-bit full-accuracy with cpol = 0 . . . . . . . . . . . . . . . . . . . . . . . . 681 figure 275. lsb justified 24-bit frame length with cpol = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 figure 276. operations required to transmit 0x3478ae. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 figure 277. operations required to receive 0x3478ae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 figure 278. lsb justified 16-bit extended to 32-bit packet frame with cpol = 0 . . . . . . . . . . . . . . . . 683 figure 279. example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683 figure 280. pcm standard waveforms (16-bit) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 figure 281. pcm standard waveforms (16-bit extended to 32-bit packet frame). . . . . . . . . . . . . . . . . 684 figure 282. audio sampling frequency definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685 figure 283. i 2 s clock generator architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685 figure 284. sdio ?no response? and ?no data? operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704 figure 285. sdio (multiple) block read operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704 figure 286. sdio (multiple) block write operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704 figure 287. sdio sequential read operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 figure 288. sdio sequential write operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 figure 289. sdio block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 figure 290. sdio adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 figure 291. control unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708 figure 292. sdio adapter command path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709 figure 293. command path state machine (cpsm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710 figure 294. sdio command transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 figure 295. data path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713 figure 296. data path state machine (dpsm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714 RM0033 list of figures doc id 15403 rev 3 43/1317 figure 297. can network topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760 figure 298. dual can block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762 figure 299. bxcan operating modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 figure 300. bxcan in silent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 figure 301. bxcan in loop back mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 figure 302. bxcan in combined mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 figure 303. transmit mailbox states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767 figure 304. receive fifo states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768 figure 305. filter bank scale configuration - register organization . . . . . . . . . . . . . . . . . . . . . . . . . . . 771 figure 306. example of filter numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772 figure 307. filtering mechanism - example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 figure 308. can error state diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774 figure 309. bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776 figure 310. can frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777 figure 311. event flags and interrupt generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778 figure 312. eth block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807 figure 313. smi interface signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808 figure 314. mdio timing and frame structure - write cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809 figure 315. mdio timing and frame structure - read cycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809 figure 316. media independent interface signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810 figure 317. mii clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812 figure 318. reduced media-independent interface signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813 figure 319. rmii clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813 figure 320. clock scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814 figure 321. address field format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816 figure 322. mac frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817 figure 323. tagged mac frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818 figure 324. transmission bit order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824 figure 325. transmission with no collision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824 figure 326. transmission with collision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 figure 327. frame transmission in mmi and rmii modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 figure 328. receive bit order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829 figure 329. reception with no error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830 figure 330. reception with errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830 figure 331. reception with false carrier indication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830 figure 332. mac core interrupt masking scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 1 figure 333. wakeup frame filter register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836 figure 334. networked time synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839 figure 335. system time update using the fine correction method. . . . . . . . . . . . . . . . . . . . . . . . . . . 841 figure 336. ptp trigger output to tim2 itr1 connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843 figure 337. pps output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844 figure 338. descriptor ring and chain structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845 figure 339. txdma operation in default mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849 figure 340. txdma operation in osf mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851 figure 341. normal transmit descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852 figure 342. enhanced transmit descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857 figure 343. receive dma operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859 figure 344. normal rx dma descriptor structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 61 figure 345. enhanced receive descriptor field format with ieee1588 time stamp enabled. . . . . . . . . 868 figure 346. interrupt scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871 figure 347. ethernet mac remote wakeup frame filter register (eth_macrwuffr). . . . . . . . . . . . 882 figure 348. block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927 list of figures RM0033 44/1317 doc id 15403 rev 3 figure 349. otg a-b device connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928 figure 350. usb peripheral-only connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930 figure 351. usb host-only connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935 figure 352. sof connectivity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939 figure 353. updating otg_fs_hfir dynamically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941 figure 354. device-mode fifo address mapping and ahb fifo access mapping . . . . . . . . . . . . . . 942 figure 355. host-mode fifo address mapping and ahb fifo access mapping . . . . . . . . . . . . . . . . 943 figure 356. interrupt hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947 figure 357. csr memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949 figure 358. transmit fifo write task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1019 figure 359. receive fifo read task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1020 figure 360. normal bulk/control out/setup and bulk/control in transactions . . . . . . . . . . . . . . . . 1022 figure 361. bulk/control in transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025 figure 362. normal interrupt out/in transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 7 figure 363. normal isochronous out/in transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1032 figure 364. receive fifo packet read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1038 figure 365. processing a setup packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1040 figure 366. bulk out transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1046 figure 367. trdt max timing case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1055 figure 368. a-device srp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1056 figure 369. b-device srp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1057 figure 370. a-device hnp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058 figure 371. b-device hnp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1060 figure 372. usb otg interface block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 5 figure 373. updating otg_hs_hfir dynamically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077 figure 374. interrupt hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079 figure 375. csr memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1081 figure 376. transmit fifo write task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1167 figure 377. receive fifo read task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1168 figure 378. normal bulk/control out/setup and bulk/control in transactions - dma mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1170 figure 379. normal bulk/control out/setup and bulk/control in transactions - slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171 figure 380. bulk/control in transactions - dma mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1174 figure 381. bulk/control in transactions - slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175 figure 382. normal interrupt out/in transactions - dma mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177 figure 383. normal interrupt out/in transactions - slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 1178 figure 384. normal isochronous out/in transactions - dma mode . . . . . . . . . . . . . . . . . . . . . . . . . 1183 figure 385. normal isochronous out/in transactions - slave mode . . . . . . . . . . . . . . . . . . . . . . . . 1184 figure 386. receive fifo packet read in slave mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1195 figure 387. processing a setup packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1197 figure 388. slave mode bulk out transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 03 figure 389. trdt max timing case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 figure 390. a-device srp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1213 figure 391. b-device srp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1214 figure 392. a-device hnp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1215 figure 393. b-device hnp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1217 figure 394. fsmc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1220 figure 395. fsmc memory banks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222 figure 396. mode1 read accesses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1229 figure 397. mode1 write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1229 figure 398. modea read accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1231 RM0033 list of figures doc id 15403 rev 3 45/1317 figure 399. modea write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1231 figure 400. mode2/b read accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233 figure 401. mode2 write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1234 figure 402. modeb write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1234 figure 403. modec read accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1236 figure 404. modec write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1237 figure 405. moded read accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1239 figure 406. moded write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1239 figure 407. multiplexed read accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1241 figure 408. multiplexed write accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1242 figure 409. asynchronous wait during a read access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1244 figure 410. asynchronous wait during a write access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1244 figure 411. wait configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1246 figure 412. synchronous multiplexed read mode - nor, psram (cram) . . . . . . . . . . . . . . . . . . . 1247 figure 413. synchronous multiplexed write mode - psram (cram) . . . . . . . . . . . . . . . . . . . . . . . . 1249 figure 414. nand/pc card controller timing for common memory access . . . . . . . . . . . . . . . . . . . 1260 figure 415. access to non ?ce don?t care? nand-flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1261 figure 416. block diagram of stm32 mcu and cortex-m3-level debug support . . . . . . . . . . . . . . . 1273 figure 417. swj debug port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1275 figure 418. jtag tap connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279 figure 419. tpiu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296 documentation conventions RM0033 46/1317 doc id 15403 rev 3 1 documentation conventions 1.1 list of abbreviations for registers the following abbreviations are used in register descriptions: 1.2 peripheral availability for peripheral availability a nd number across all stm32f20 x and stm32f21x sales types, please refer to the stm32f20x and stm32f21x datasheets. read/write (rw) software can read and write to these bits. read-only (r) software can only read these bits. write-only (w) software can only write to this bit. reading the bit returns the reset value. read/clear (rc_w1) software can read as well as clear this bit by writing 1. writing ?0? has no effect on the bit value. read/clear (rc_w0) software can read as well as clear this bit by writing 0. writing ?1? has no effect on the bit value. read/clear by read (rc_r) software can read this bit. reading this bit automatically clears it to ?0?. writing ?0? has no effect on the bit value. read/set (rs) software can read as well as set this bit. writing ?0? has no effect on the bit value. read-only write trigger (rt_w) software can read this bit. writing ?0? or ?1? triggers an event but has no effect on the bit value. toggle (t) software can only toggle this bit by writing ?1?. writing ?0? has no effect. reserved (res.) reserved bit, must be kept at reset value. RM0033 memory and bus architecture doc id 15403 rev 3 47/1317 2 memory and bus architecture 2.1 system architecture the main system consists of 32-bit mult ilayer ahb bus matrix that interconnects: height masters: ? cortex-m3 core i-bus, d-bus and s-bus ? dma1 memory bus ? dma2 memory bus ? dma2 peripheral bus ? ethernet dma bus ? usb otg hs dma bus seven slaves: ? internal flash memory icode bus ? internal flash memory dcode bus ? main internal sram1 (112 kb) ? auxiliary internal sram2 (16 kb) ? ahb1peripherals including ahb to apb bridges and apb peripherals ? ahb2 peripherals ?fsmc the bus matrix provides access from a master to a slave, enabling concurrent access and efficient operation even when several high-speed peripherals work simultaneously. this architecture is shown in figure 1 . memory and bus architecture RM0033 48/1317 doc id 15403 rev 3 figure 1. system architecture 2.1.1 s0: i-bus this bus connects the instruction bus of the cortex-m3 core to the busmatrix. this bus is used by the core to fetch instructions. the target of this bus is a memory containing code (internal flash memory/sram or exte rnal memories through the fsmc). 2.1.2 s1: d-bus this bus connects the databus of the cortex-m3 to the busmatrix. this bus is used by the core for literal load and debug access. the target of this bus is a memory containing code or data (internal flash memory /sram or external memories through the fsmc). 2.1.3 s2: s-bus this bus connects the system bus of the cortex-m3 core to a busmatrix. this bus is used to access data located in a peripheral or in sram. instructions may also be fetch on this bus (less efficient than icode). the targets of this bus are the 112 kb & 16 kb internal srams, the ahb1 peripherals including the apb peripher als, the ahb2 peripher als and the external memories through the fsmc. 2.1.4 s3, s4: dma memory bus this bus connects the dma memory bus master interface to the busmatrix. it is used by the dma to perform transfer to/from memories. the targets of this bus are data memories: internal sram and external memories through the fsmc. ! 2 - # o r t e x - ' 0 $ - ! ' 0 $ - ! - ! # % t h e r n e t 5 3 " / 4 ' ( 3 " u s m a t r i x 3 3 3 3 3 3 3 3 3 ) # / $ % $ # / $ % ! 2 4 ! # # % , & |